package com.rwb.springboot.sell.service;

import com.rwb.springboot.sell.dto.CartDTO;
import com.rwb.springboot.sell.po.ProductInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by ruwenbo on 2017/12/17.
 */
public interface ProductInfoService {

    ProductInfo findOne(String productId);

    /**]
     * 查询所有上架商品
     * @return
     */
    List<ProductInfo> findUpAll();

    Page<ProductInfo> findAll(Pageable pageable);

    ProductInfo save(ProductInfo productInfo);

    // 加库存
    void increaseStock(List<CartDTO> cartDTOList);

    // 减库存
    void decreaseStock(List<CartDTO> cartDTOList);

}
